import { createRouter, createWebHashHistory  } from "vue-router";

const routes = [
    {
        path: "/main",
        name: "Main",
        component: () => import('../views/MainView.vue'),
        children: [
            {
                path: "/travel",
                name: "Travel",
                component: () => import('../views/menu-function/Travel.vue'),
                meat: {
                    title: "旅行",
                    icon: 'icon-lvyou'
                }
            },
            {
                path: "/airticket",
                name: "Airticket",
                component: () => import('../views/menu-function/Air-ticket.vue'),
                meat: {
                    title: "机票",
                    icon: 'icon-feijipiao'
                }
            },
            {
                path: "/bus-ticket",
                name: "Bus-ticket",
                component: () => import('../views/menu-function/Bus-ticket.vue'),
                meat: {
                    title: "汽车票",
                    icon: 'icon-qichepiao'
                }
            },
            {
                path: "/train-ticket",
                name: "Train-ticket",
                component: () => import('../views/menu-function/Train-ticket.vue'),
                meat: {
                    title: "火车票",
                    icon: 'icon-huochepiao'
                }
            },
            {
                path: "/steamer-ticket",
                name: "Steamer-ticket",
                component: () => import('../views/menu-function/Steamer-ticket.vue'),
                meat: {
                    title: "船票",
                    icon: 'icon-chuanpiao'
                }
            }
        ]
    },    
    {
        path: "/login",
        name: "Login",
        component: () => import('../views/LoginView.vue'),
    },
    {
        path: "/hotaltips",
        name: "Hotaltips",
        component: () => import('../views/Hotaltips.vue'),
    },
    {
        path: '/manager',
        name: 'Manager',
        component: () => import('../views/Manager.vue')
    },
    {
        path: '/myorder',
        name: 'MyOrder',
        component: () => import('../views/MyOrder.vue')
    },
    {
        path: '/order',
        name: 'Order',
        component: () => import('../views/Order.vue')
    },
    {
        path: '/payback',
        name: 'PayBack',
        component: () => import('../views/PayBack.vue')
    },
    {
        path: '/pay',
        name: 'Pay',
        component: () => import('../views/Pay.vue')
    },
    {
        path: '/error',
        name: 'Error',
        component: () => import('../views/Error.vue')
    },
    //设置首页面
    {
        path: "/",
        redirect: "/main"
    }
];

const router = createRouter({
    history: createWebHashHistory(),
    routes,
});

export default router;
